package ${meta.basePackage}${meta.moduleName};

import com.github.wenhao.jpa.Specifications;
import org.springframework.data.jpa.domain.Specification;
<#list queryCriteriaList as qc>
    <#list columns as field>
        <#list columns as field2>
            <#if field.type == field2.type>
                <#if field_index==field2_index && !field.type?contains('java.lang') && qc.name==field.name>
                    import ${field.type};
                <#else>
                    <#break >
                </#if>
            </#if>
        </#list>
    </#list>
</#list>
/**
* @author admin
* @date ${meta.cratedDate}
*/
public interface ${name}Spec{

<#if queryCriteriaList?size != 0>
    Spec<${name}> toSpec(
<#list queryCriteriaList as item >
       ${getType(item.name)?split('.')?last} ${item.name}<#if queryCriteriaList?size \gt item_index+1>, </#if>
</#list>   ){
    return Specification.<${name}>and.
<#list queryCriteriaList as item >
         ${lineToHump(item.criteriaType)}(Objects.notNull(${item.name}), "${item.name}" ,${item.name})
</#list>     .build();
   }
</#if>
}
